import { usePermissionStore } from '@/store'
export const useAuthTabs = (options) => {
  const permissionStore = usePermissionStore()
  const permissions = permissionStore?.permissions || []
  const tabs = computed(() => {
    return options.filter((item) => permissions.includes(item.key))
  })
  const active = ref('')
  watchEffect(() => {
    active.value = tabs.value.length ? tabs.value[0].value : ''
  })
  return { tabs, active }
}
